package io.github.cunyu1943;

/**
 * Created with IntelliJ IDEA.
 *
 * @Package : io.github.cunyu1943
 * @ClassName : ReplaceTest.java
 * @CreateTime : 2022/11/29 22:32
 * @Version : 1.0
 * @Author : 村雨遥
 * @Email : 747731461@qq.com
 * @公众号 : 村雨遥
 * @Website : https://cunyu1943.github.io/JavaPark
 * @Description : 字符替换
 */
public class ReplaceTest {
    public static void main(String[] args) {
        char ch1 = 'u';
        char ch2 = 'x';

        String str = "cunyu1943";

        System.out.println("原字符串: " + str);
        System.out.println("替换后的字符串: " + str.replace(ch1, ch2));
    }
}
